#!/bin/bash

echo "Now training the AlexNet model..."
./build/tools/caffe train $* --solver=models/bvlc_alexnet/solver.prototxt
mv LOG/Device_0/CuptiOverhead/* LOG/Device_0/AlexNet/CuptiOverhead/
if [ -d "LOG/Device_0/BufferOverhead" ]; then
    mv LOG/Device_0/BuffOverhead LOG/Device_0/AlexNet-BuffOverhead
fi
echo "Finished the training the AlexNet model..."
echo ""
echo ""

echo "Now training the GoogleNet model..."
./build/tools/caffe train $* --solver=models/bvlc_googlenet/solver.prototxt
mv LOG/Device_0/CuptiOverhead/* LOG/Device_0/GoogleNet/CuptiOverhead/
if [ -d "LOG/Device_0/BufferOverhead" ]; then
    mv LOG/Device_0/BuffOverhead LOG/Device_0/GoogleNet-BuffOverhead
fi
echo "Finished the training the GoogleNet model..."
echo ""
echo ""

echo "Now training the ResNet18 model..."
./build/tools/caffe train $* --solver=models/resnet18/solver.prototxt
mv LOG/Device_0/CuptiOverhead/* LOG/Device_0/Resnet18/CuptiOverhead/
if [ -d "LOG/Device_0/BufferOverhead" ]; then
    mv LOG/Device_0/BuffOverhead LOG/Device_0/Resnet18-BuffOverhead
fi
echo "Finished the training the ResNet18 model..."
echo ""
echo ""

echo "Now training the VGG16 model..."
./build/tools/caffe train $* --solver=models/vgg16/solver.prototxt
mv LOG/Device_0/CuptiOverhead/* LOG/Device_0/VGG16/CuptiOverhead/
if [ -d "LOG/Device_0/BufferOverhead" ]; then
    mv LOG/Device_0/BuffOverhead LOG/Device_0/VGG16-BuffOverhead
fi
echo "Finished the training the VGG16 model..."
echo ""
echo ""

rm -rf LOG/Device_0/CuptiOverhead
